#include <stdio.h>
#include <ctype.h>
#define N 20
int main(void)
{
    char ch, fname = ' ';
    char lname[N] = {};
    printf("Enter a first and last name: ");
    while ((ch = getchar()) != '\n') {
        if (fname == ' ')
            fname = toupper(ch);
        else 
            if (ch == ' ') {
                while ((ch = getchar()) == ' ')
                    /* 空语句 */;
                int i = 0;
                do {
                    lname[i] = ch;
                    i++;
                    ch = getchar();
                } while (ch != ' ' && ch != '\n');
                break;
            }
    }
    printf("You enered the name: %s, %c.\n", lname, fname);
    return 0;
}